package com.leyou.item.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.item.dto.CategoryDTO;
import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;


/**
 * @author Eric
 * @version v1.0
 * @package com.leyou.item.mapper
 * @date 2019/6/22 19:46
 * @description:
 **/
public interface CategoryMapper extends BaseMapper<Category> {
    @Select("select tc.id,tc.`name`,tc.is_parent,tc.parent_id,tc.sort from tb_category tc left join tb_category_brand tcb on tcb.category_id=tc.id WHERE brand_id=#{bid}")
    List<CategoryDTO> queryByBrandId(@Param("bid") Long brandId);
}
